package com.qianniu.napi.admin.service.impl;

import com.qianniu.napi.admin.entity.Jifen;
import com.qianniu.napi.admin.mapper.JifenMapper;
import com.qianniu.napi.admin.service.IJifenService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.qianniu.napi.common.util.ObjectUtil;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 积分表 服务实现类
 * </p>
 *
 * @author chenxuebin
 * @since 2018-09-04
 */
@Service
public class JifenServiceImpl extends ServiceImpl<JifenMapper, Jifen> implements IJifenService {

    public Jifen initJifen(){

        Jifen jifen = new Jifen();
        jifen.setTotal(new BigDecimal(0));
        jifen.setState(1);
        jifen.setVersion(1l);
        jifen.setUid(ObjectUtil.getUid());
        jifen.setMid(ObjectUtil.getMid());
        jifen.setMpid(ObjectUtil.getMpid());
        jifen.setCreatetime(new Date());
        jifen.insert();

        return jifen;
    }

}
